home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 79 / maccd 79.iso / multimedial / GL Tron / Source / gltron / configure.in < prev    next >
Encoding:
Text File  |  2001-07-10  |  3.5 KB  |  133 lines  |  [TEXT/CWIE]

  1. dnl Process this file with autoconf to produce a configure script.
  2.  
  3. dnl any file will do
  4. AC_INIT(camera.c)
  5.  
  6.  
  7. dnl Checks for programs.
  8.  
  9. dnl Checks for libraries.
  10. dnl Replace `main' with a function in -lGL:
  11. LIBS='-L/usr/X11R6/lib'
  12.  
  13. AC_PROG_CC
  14. AC_PROG_CPP
  15. AC_PROG_INSTALL
  16. AC_PROG_LN_S
  17. AC_PROG_MAKE_SET
  18.  
  19. CFLAGS=""
  20.  
  21. AC_ARG_ENABLE(warn,
  22. [ --enable-warn                Enable compiler warnings [default=on]],
  23.     enable_warn=$enableval, enable_warn=yes)
  24. if test "x$enable_warn" = xyes; then
  25.     CFLAGS="$CFLAGS -Wall"
  26. fi
  27.  
  28. AC_ARG_ENABLE(debug,
  29. [ --enable-debug               Enable debugging [default=off]],
  30.     enable_debug=$enableval, enable_debug=off)
  31. if test "x$enable_debug" = xyes; then
  32.     CFLAGS="$CFLAGS -g3"
  33. fi
  34.  
  35. AC_ARG_ENABLE(profile,
  36. [ --enable-profile             Enable profiling [default=off]],
  37.     enable_profile=$enableval, enable_profile=off)
  38. if test "x$enable_profile" = xyes; then
  39.     if test "x$GCC" = xyes; then
  40.         CFLAGS="$CFLAGS -pg"
  41.     else
  42.         CFLAGS="$CFLAGS -p"
  43.     fi
  44. fi
  45.  
  46. AC_ARG_ENABLE(optimize,
  47. [ --enable-optimize=[level]    Enable optimization [default=2]],
  48.     enable_optmize=$enableval, enable_optimize=2)
  49. if test "x$enable_optimize" ; then
  50.     CFLAGS="$CFLAGS -O$enable_optimize"
  51. fi
  52.  
  53. AC_ARG_ENABLE(network,
  54. [ --enable-network             Experimental network mode [default=off]],
  55.     enable_network=$enableval, enable_network=off)
  56. if test "x$enable_network" = xyes; then
  57. AC_CHECK_LIB(SDL_net, main,, AC_MSG_ERROR(SDL_net is needed))
  58.     ${LN_S} -f system_net_sdl.c system_net.c
  59.     ${LN_S} -f system_net_sdl.h system_net.h
  60.     CFLAGS="$CFLAGS -DNETWORK"
  61.     LIBS="$LIBS -lSDL_net"
  62.     NETWORK_FILES="network.c system_net.c"
  63.     AC_SUBST(NETWORK_FILES)
  64. fi
  65.  
  66. AC_ARG_ENABLE(sound,
  67. [ --disable-sound              Dont compile in sound [default=off]],
  68.    use_sound=no, use_sound=yes)
  69.  
  70. AC_CHECK_LIB(m, main,, AC_MSG_ERROR(libm is needed))
  71. AC_CHECK_LIB(X11, main,, AC_MSG_ERROR(X11 is needed, course))
  72. AC_CHECK_LIB(GL, main,, AC_MSG_ERROR(OpenGL is needed))
  73. dnl AC_CHECK_LIB(GLU, main,, AC_MSG_ERROR(GLU should come with OpenGL))
  74. AC_CHECK_LIB(pthread, main,, AC_MSG_ERROR(SDL needs pthread to run properly))
  75.  
  76. AC_CHECK_LIB(SDL, main, 
  77. ${LN_S} -f system_sdl.c system.c ; \
  78. ${LN_S} -f system_sdl.h system.h ; \
  79. LIBS="$LIBS -lSDL" ; \
  80. HAVE_SDL=1,
  81. AC_CHECK_LIB(glut, main, 
  82. ${LN_S} -f system_glut.c system.c ; \
  83. ${LN_S} -f system_glut.h system.h ; \
  84. LIBS="$LIBS -lglut", \
  85. AC_MSG_ERROR(Neither SDL or glut is installed!)))
  86.  
  87. if test "x$use_sound" = xyes; then
  88.     SOUND_FILE="sound.c"
  89.     AC_SUBST(SOUND_FILE)
  90.     AC_CHECK_LIB(SDL_mixer, main,
  91.     ${LN_S} -f sound_sdl.c sound.c ; \
  92.     ${LN_S} -f sound_sdl.h sound.h ; \
  93.     CFLAGS="$CFLAGS -DSOUND"; \
  94.     LIBS="$LIBS -lSDL_mixer", 
  95.     AC_CHECK_LIB(mikmod, main,
  96.     ${LN_S} -f sound_libmikmod.c sound.c ; \
  97.     ${LN_S} -f sound_libmikmod.h sound.h ; \
  98.     CFLAGS="$CFLAGS -DSOUND"; \
  99.     LIBS="$LIBS -lmikmod",
  100.     AC_MSG_ERROR(Neither SDL_mixer nor libmikmod is installed!)))
  101. fi
  102.  
  103. AC_CHECK_LIB(z, main,, AC_MSG_ERROR(libz is needed))
  104. AC_CHECK_LIB(png, main,, AC_MSG_ERROR(libpng is needed))
  105.  
  106. AC_HEADER_STDC
  107. AC_CHECK_HEADERS(unistd.h)
  108.  
  109. AC_CHECK_HEADERS(GL/gl.h,,
  110.  AC_CHECK_HEADERS(/usr/X11R6/include/GL/gl.h,
  111.     includes_in_x=1,
  112.  AC_CHECK_HEADERS(/usr/local/include/GL/gl.h,
  113.     includes_in_local=1,
  114. AC_MSG_ERROR(cant find GL headers))))
  115.  
  116. if test "$includes_in_x" = 1 ; then
  117.     INCS="$INCS -I/usr/X11R6/include"
  118. fi
  119.  
  120. if test "$includes_in_local" = 1; then
  121.     INCS="$INCS -I/usr/local/include"
  122. fi
  123.  
  124. AC_SUBST(INCS)
  125.  
  126. dnl Checks for typedefs, structures, and compiler characteristics.
  127. AC_C_CONST
  128.  
  129. dnl Checks for library functions.
  130. AC_CHECK_FUNCS(strstr)
  131.  
  132. AC_OUTPUT(Makefile)
  133.